package com.sakila.action.category;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.sakila.pojo.Category;
import com.sakila.service.CategoryService;

@Controller
@RequestMapping(value={"/","/staff"})
public class CategoryAction {
	@Resource
	private CategoryService categoryService;
	
	@RequestMapping(value="/viewCategories")
	@ResponseBody
	public Object viewCategories(){
		List<Category> list = categoryService.findAll();
		
		//for easy ui combo-box
		return list;
	}
}
